#pragma once

#include <QBrush>
#include <QColor>
#include <QDebug>
#include <QDesktopServices>
#include <QDialog>
#include <QFont>
#include <QHeaderView>
#include <QMainWindow>
#include <QTableWidget>
#include <QTableWidgetItem>
#include <QTextEdit>
#include <QUrl>
#include <memory>
#include <string>
#include <vector>

#include "DataMgr.h"
#include "HttpPost.h"
#include "HttpPostLuogu.h"

class QLineEdit;
class SpiderDataDlg : public QDialog
{
    Q_OBJECT

public:
    SpiderDataDlg(QWidget* parent = nullptr);
    void addInfo(const QString& str);

    bool onePost(const QString& strUrl, const QString& strLocalFile);
    void onePostAtPage(const QString& strID, const QString& strLocalFile);

    bool onePostLuogu(const QString& strUrl, QStringList& lstTag,
                      int& nDiffcult);

    bool m_bStartup = false;

public:
    QTextEdit* m_log;
    HttpPost post;
    HttpPostLuogu postLuogu;
    bool m_bStop = true;
public slots:
    void slotAtCoder();
    void slotCodeforces();
    void slotLuoguCF();
    void slotLuoguAT();
};
